package com.example.sources.jdbc;

import com.example.dao.UserDao;
import com.example.entity.UserInfo;
import com.example.sources.jdbc.proxy.DaoInvocationHandlerImpl;
import com.example.sources.jdbc.proxy.DynamicProxy;

import java.util.List;

/**
 * Created by Administrator on 2016/9/18.
 */
public class Client {
    public static void main(String[] args) {
        UserDao userDao = DynamicProxy.newProxyInstance(DaoInvocationHandlerImpl.class.getClassLoader(), new Class[]{UserDao.class}, new DaoInvocationHandlerImpl());
        UserInfo userInfo = userDao.findByname("123");
        Long count = userDao.findBynameCount("123");
        String pwd = userDao.findPasswordBynameCount("123");
        List<UserInfo> userInfoList = userDao.findByType(0);
        for (UserInfo userInfo1 : userInfoList){
            System.out.println("list "+ userInfo1.getUsername());
        }
        System.out.println("pwd "+pwd);
        System.out.println("usercount "+count);
        System.out.println(userInfo.getUsername());
        System.out.println(userInfo.getPassword());
        System.out.println(userInfo.getId());
//    TypeUtil.isIterable("java.util.List");
    }
}
